<template>
	<view class="classLayout pageBg">
		<customNavbar title="分类"></customNavbar>
		<view class="classify">
			<ThemeItem v-for="item in classifyList" :key="item._id" :item="item"></ThemeItem>
		</view>
	</view>
</template>

<script setup>
	import {onMounted, ref} from 'vue'
	import {apiGetClassify} from '@/apis/index.js'
	import {onShareAppMessage,onShareTimeline}from '@dcloudio/uni-app'
	
	const classifyList = ref([])
	
	const getClassify = async()=>{
		const res  =await apiGetClassify({
			pageSize:100
			})
		classifyList.value = res.data.data
		console.log(res);
	}

	onMounted(()=>{
		getClassify()
	})
	
	// 分享给好友
		onShareAppMessage((e)=>{
			console.log(e);
			return{
				title:'壁纸大全,精选分类',
				path:'/pages/index/index'
			}
		})
	
	// 分享朋友圈
	onShareTimeline(()=>{
		return{
			title:'壁纸大全，精选分类',
			imageUrl:'/static/logo.jpg'
		}
	})
</script>

<style lang="scss" scoped>
.classLayout{
	.classify{
		padding: 30rpx;
		display: grid;
		grid-template-columns: repeat(3,1fr);
		gap: 15rpx;
	}
}
</style>
